//app.js
App({
  onLaunch: function () {
   
  },
  fetch(url, data,type, callback) {
    let that=this;
    let hd = { 'Content-Type': 'application/json' };
    if(type=="POST"){
      hd = { 'content-type': 'application/x-www-form-urlencoded' };
    }
    wx.request({
      url: that.globalData.url+url+'.php',
      data: data,
      method: type,
      header: hd,
      success(res) {
        callback(null, res.data);
      },
      fail(e) {
        callback(e);
      }
    })

  },
  globalData: {
    userInfo: null,
    url:"https://hysq.xkji.cn/"
  }
})